package control.servlet.compte;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import control.bd.table.User;

import control.bd.requete.Requetes;


public class ModifierCompte extends HttpServlet {

        /**
         * 
         */
        private static final long serialVersionUID = 1L;

        public void doGet(HttpServletRequest request, HttpServletResponse response)
                throws IOException, ServletException{
                
                String login = request.getParameter("login");
                String mdp = request.getParameter("password");
                String mail = request.getParameter("email");
                String nom = request.getParameter("nom");
                String prenom = request.getParameter("prenom");
                String adresse = request.getParameter("adresse");
                String tel = request.getParameter("tel");
        
        
                boolean ok = Requetes.update(login,mdp,mail,nom,prenom,adresse,tel);
                 if(ok == true){
                           request.getRequestDispatcher("/Client/fin.jsp").forward(request, response);
                   }else{
                           request.getRequestDispatcher("/Authentification/connexion.html").forward(request, response); 
                   } 
                 
        }   
        

}